import java.util.Scanner;

public class q34 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
      System.out.println("请输入一个正整数");
       int b=input.nextInt();


        int c=0;
        while (b!=0){
            c+=b%10;
            b=b/10;


        }System.out.println(c);




    }
}
